'use strict';



import React, { Component } from 'react';

import {
	View,
  Image,
  Dimensions,
  TouchableWithoutFeedback,
  StyleSheet,
  Text,
  TouchableOpacity,
  TextInput,
  ScrollView,
	TouchableHighlight,
	TouchableNativeFeedback

} from 'react-native';

import  ToastUtil  from 'shequnsiweiapp/src/core/utils/ToastUtil.js';
import  CameraButton  from 'shequnsiweiapp/src/core/component/CameraButton.js';



let winWidth  = Dimensions.get('window').width;//屏幕宽度

let winHeight  = Dimensions.get('window').height;//屏幕高度




let headImgEmpty = require('shequnsiweiapp/src/img/headImg_empty.png');
import  Http  from 'shequnsiweiapp/src/core/utils/Http.js';




const BORDER_COLOR_NORMAL='#DDD';

const BORDER_COLOR_RED='#ff0000';

const BUTTON_BGCOLOR_ENABLE = '#FFC000';

const BUTTON_BGCOLOR_DISABLE = '#FFC000';

const BUTTON_COLOR_ENABLE = '#FFFFFF';

const BUTTON_COLOR_DISABLE = '#FFC000';

class UserInfoScene extends React.Component {
// 构造
constructor(props)
{
	super(props);


	

//	this.onFileUpload.bind(this);


}

	



styleInputbox()

{

	return {
		flexDirection: 'row',
		marginLeft: 40,
		marginRight: 40,
		marginTop: 10,
		borderColor:this.state.borderColor,
		borderRadius: 8,
		borderWidth: 1,
		justifyContent: 'center',
		alignItems: 'center',
		height: 40
	}
}





	 
 





	render(){
	   if(!this.state.loaded){

		   return (
			   <View>
				   <Text>loading.....</Text>
			   </View>
		   )
	   }else{
		   return(

				   <View style={styles.body}>

					   



                         <Image style={styles.topBg}
						   source={require('shequnsiweiapp/src/img/login_top_bg.png')}>



						   <View style={{width:120,height:120,backgroundColor:'#ffffff',borderColor:'#000000',borderRadius:60,borderWidth:1,
						   justifyContent:'center',alignItems:'center'}}>
						   		<CameraButton 
                                  photos={[]}
                                  onFileUpload={this.onFileUpload}
								  name={'touxiang'} />
							   </View>
							   
					   </Image>



					   <View style={this.styleInputbox()}>
						   <Image style={styles.icon}
							   resizeMode={'contain'}
							   source={require('shequnsiweiapp/src/img/login_user.png')}/>


						   <TextInput style={styles.inputText}
						   placeholder={'真实姓名'}
						   placeholderTextColor={'#CCC'}
						   underlineColorAndroid="transparent"
						   value={this.state.mobile}
						   onChangeText={(text)=>{this.setState({xingming:text})}}/>
					   </View>





					   <View style={styles.inputBox}>
						   <Image style={styles.icon}
							   resizeMode={'contain'}
							   source={require('shequnsiweiapp/src/img/login_pwd.png')}/>


						   <TextInput style={styles.inputText}
							   placeholder={'出生日期'}
							   placeholderTextColor={'#CCC'}
							   underlineColorAndroid="transparent"
							   onChangeText={(text)=>{this.setState({'password':text})}}
						   />
					   </View>




					   <View style={styles.inputBox}>
						   <Image style={styles.icon}
							   resizeMode={'contain'}
							   source={require('shequnsiweiapp/src/img/login_pwd.png')}/>


						   <TextInput style={styles.inputText}
							   placeholder={'所在公司'}
							   placeholderTextColor={'#CCC'}
							   underlineColorAndroid="transparent"
							   onChangeText={(text)=>{this.setState({'rePassword':text})}}
						   />
					   </View>





					   <View style={styles.xiayibu_view}>
						   <TouchableHighlight onPress={this.submit.bind(this)} style={{flex:1}}>
							   <Text style={{alignSelf:'center',fontSize:15,color:'#FFFFFF'}}>注册</Text>
						   </TouchableHighlight>
					   </View>


					   <View style={styles.loginHref_view}>

						   <Text style={{alignSelf:'center',fontSize:15,color:'#959595'}}>已注册，</Text>
						   <TouchableHighlight 
						   onPress={() => this.props.navigation.navigate('Login', {name: 'Lucy'})}
						   >
							   <Text style={{alignSelf:'center',fontSize:15,color:'#0404F2'}}>直接登陆</Text>
						   </TouchableHighlight>
					   </View>

				


				   </View>




		   )
	   }




    }

}




const styles = StyleSheet.create({
	body: {
		backgroundColor: '#FFF',
		height:winHeight,
		flex: 1,
	},
	topBg: {
		width: winWidth,
		height: winWidth / 5 * 3,
		justifyContent: 'center',
		alignItems: 'center',
		marginBottom: 2,
		
	},

	loginText: {
		fontSize: 18,
		color: '#FFF',
		position: 'absolute',
		top: 10,
	},
	headImg_out:{
		justifyContent:'center',
		alignItems:'center',
		flex:1,
		borderWidth:0,
		borderColor:'#dd2c2c',
		marginLeft:2,
		marginRight:2,

	},
	headImg:{
		height:100,
		width:100,
		borderRadius: 50,


	},
	yanzhengma_viewOut:{
		height: 40,
		flexDirection: 'row',
		justifyContent:'flex-start',
		marginLeft: 40,
		marginRight: 40,
		marginTop: 10,

	},
		yanzhengma_inputbox:{

          flex:2,
			marginLeft: 0,
			marginRight: 10,
			marginTop: 0,
			marginBottom: 0,
			borderColor: '#DDD',
			borderRadius: 8,
			borderWidth: 1,
			flexDirection: 'row',
			justifyContent: 'center',
			alignItems: 'center',

		}

	,inputBox: {
		flexDirection: 'row',
		marginLeft: 40,
		marginRight: 40,
		marginTop: 10,
		borderColor: '#DDD',
		borderRadius: 8,
		borderWidth: 1,
		justifyContent: 'center',
		alignItems: 'center',
		height: 40
	}
	,xiayibu_view: {
	   flexDirection: 'row',
		marginLeft: 40,
		marginRight: 40,
		marginTop: 5,
		borderColor: '#DDD',
		borderRadius: 15,
		borderWidth: 1,
		justifyContent: 'center',
		alignItems: 'center',
		height: 40,
		backgroundColor:'#0404F2',
},
	loginHref_view: {
	  flexDirection: 'row',
		marginLeft: 80,
		marginRight: 80,
		marginTop: 5,
		justifyContent: 'center',

},
	icon: {
		height: 15,
		width: 15,
		marginLeft: 10,
		marginRight: 10,
	},
	inputText: {
		flex: 1,
		marginRight: 10,
	},
	inputTextYanzhengma: {
		flex:3,
		marginRight:3,

	},

	addIdPicBox: {
		marginLeft: 40,
		marginRight: 40,
		marginTop: 10,
	},
	addIdPic: {
		height: 80,
		width: 80,
		marginLeft: 12,
		marginTop: 6,
	},
	loginBtn: {
		height: 40,
		borderRadius: 8,
		backgroundColor: '#00F',
		marginRight: 40,
		marginLeft: 40,
		marginTop: 20,
		justifyContent: 'center',
		alignItems: 'center',
	},
	btnText: {
		fontSize: 15,
		color: '#FFF',
	},
	inputErrorView:{

		marginLeft: 60,
		marginTop: 1,
       marginBottom:1,

	},
	inputErrorTxt:{

		color:'#DF4849'
	}
});

module.exports= UserInfoScene;